extends INamedNode


class_name NamedNode
"""
带命名标识的节点接口
"""


## 引用的组件(可选,默认为第一个子节点)
@export var wrapper: Node = null


func __check_exports() -> Dictionary:
    return IComponent.merge({
        "wrapper": [IComponent.find_child.bind(self, func(x): return x is Node, wrapper)],
    }, super.__check_exports())

func get_reference() -> Node:
    return wrapper

func get_items() -> Dictionary:
    if wrapper and wrapper is NamedNode:
        return wrapper.get_items()
    return {name: wrapper}
